<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
		/* 权重：100 + 10 +1 权重最大*/  
        #box1 .spec2 p {
			color:red;
		}
        /* 权重 1 + 1 + 100 +1 */
		div div #box3 p {
			color:blue;
		}
        /* 权重 11 +11 + 11 + 1 */
		div.spec1 div.spec2 div.spec3 p {
			color:green;
		}
	</style>
</head>
<body>
    <div id="box1" class="spec1">
		<div id="box2" class="spec2">
			<div id="box3" class="spec3">
				<p>文字</p>
			</div>
		</div>
    </div>
</body>
</html>